Update parent repository:
    tags:
        - docker-nonswiss-ok
    variables:
        GIT_STRATEGY: none
        PARENT_REPOSITORY_BRANCH: main
        PARENT_REPOSITORY_ID: 2131 # https://gitlab.liip.ch/swing/defivelo/intranet/
        SUBMODULE_PATH: locale
        SUBMODULE_UPDATE_COMMIT_MESSAGE: "i18n: Auto update of ./${SUBMODULE_PATH}"
        WEBLATE_PRIVATE_TOKEN: "This needs to be set in repository CI / CD Settings → Variables"
    image: curlimages/curl
    only:
        refs:
            - master
    script:
        - 'RETURN=`mktemp`;
           echo "Set path ${SUBMODULE_PATH} to commit ${CI_COMMIT_SHA} on branch ${PARENT_REPOSITORY_BRANCH} from repo ${PARENT_REPOSITORY_ID}";
           STATUS_CODE=`curl --silent --request PUT --header "PRIVATE-TOKEN: ${WEBLATE_PRIVATE_TOKEN}" "https://gitlab.liip.ch/api/v4/projects/${PARENT_REPOSITORY_ID}/repository/submodules/${SUBMODULE_PATH}" --data "branch=${PARENT_REPOSITORY_BRANCH}&commit_sha=${CI_COMMIT_SHA}&commit_message=${SUBMODULE_UPDATE_COMMIT_MESSAGE}" --output $RETURN --write-out "%{http_code}"`;
           cat $RETURN;
           echo "";
           if [ $STATUS_CODE -ne 200 ]; then
              >&2 echo "CURL call failed with status code $STATUS_CODE";
              false;
           fi'
